package com.cy.controller;

import com.cy.validation.NotEquals;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@Validated
@RestController
public class DemoController {

    @GetMapping("/calc/{n1}/{n2}")
    public String calc(
            @PathVariable Integer n1,
            @PathVariable @NotEquals(0) Integer n2){
        Integer result =n1/n2;
        return "result=" + result;
    }

}
